package com.happy3w.ssp.schoolmatehome.controller;

import lombok.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
import java.util.Set;

@RequiredArgsConstructor
@RestController
@RequestMapping("/api/checker")
public class ChatCheckerController {

    @PostMapping()
    public CheckRsp check(@RequestBody CheckReq req) {
        Set<String> roles = Set.of("admin");
        return CheckRsp.builder()
                .message("ok")
                .roles(roles)
                .build();
    }

    @Getter
    @Setter
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class CheckReq {
        private String bot;
        private Map<String, Object> params;
    }


    @Getter
    @Setter
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    public static class CheckRsp {
        private String message;
        private Set<String> roles;
    }

}
